Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support ScanNet semantic segmentation dataset #390

Merged
merged 43 commits into from
Apr 7, 2021

Conversation

Wuziyi616
Copy link
Contributor

Add ScanNet dataset for semantic segmentation task, including data pre-processing, data loading for train and test, evaluation metrics and result visualization.

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #390 (91e6e1f) into master (d055876) will increase coverage by 0.97%.
The diff coverage is 76.17%.

❗ Current head 91e6e1f differs from pull request most recent head dd0f856. Consider uploading reports for the commit dd0f856 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #390      +/-   ##
==========================================
+ Coverage   49.73%   50.70%   +0.97%     
==========================================
  Files         181      182       +1     
  Lines       12445    12765     +320     
  Branches     1950     2014      +64     
==========================================
+ Hits         6189     6473     +284     
- Misses       5867     5875       +8     
- Partials      389      417      +28     
Flag Coverage Δ
unittests 50.70% <76.17%> (+0.97%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdet3d/datasets/pipelines/__init__.py 100.00% <ø> (ø)
mmdet3d/datasets/pipelines/formating.py 54.73% <0.00%> (ø)
mmdet3d/core/evaluation/seg_eval.py 16.32% <12.50%> (-1.86%) ⬇️
mmdet3d/core/visualizer/show_result.py 75.00% <66.66%> (-4.67%) ⬇️
mmdet3d/datasets/custom_3d_seg.py 67.14% <67.14%> (ø)
mmdet3d/datasets/pipelines/transforms_3d.py 84.93% <82.95%> (+0.59%) ⬆️
mmdet3d/core/points/base_points.py 80.92% <88.88%> (+15.01%) ⬆️
mmdet3d/datasets/pipelines/loading.py 83.13% <89.47%> (+8.96%) ⬆️
mmdet3d/core/visualizer/__init__.py 100.00% <100.00%> (ø)
mmdet3d/datasets/__init__.py 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d055876...dd0f856. Read the comment docs.

@Wuziyi616
Copy link
Contributor Author

In general, I did five things in this PR.

  1. I modify the ScanNet pre-processing files used in the point cloud detection task. I remove the max_num_point subsampling in preprocessing.
  2. I write data loading pipelines for train and test data generation. The core class is IndoorPatchPointSample where we perform sampling to get NUM_POINTS points within a patch (usually 1.5mx1.5m) as one entry. In training, we randomly sample this patch, while in testing, we use the sliding window strategy. Also, I modify some functions in BasePoint to accommodate the pipelines.
  3. I write a dataset class for semantic segmentation. I think it's quite different from the detection dataset, because we need to support room re-sampling and label re-weighting. I also write a ScanNet segmentation config file based on its detection counterpart.
  4. I modify the segmentation evaluation function. In the indoor scene segmentation task, there are some unannotated points, marked by ignore_index in the code. So we need to filter them in loss calculation & evaluation metrics & visualizations.
  5. I write a visualization function for semantic segmentation.

mmdet3d/core/evaluation/seg_eval.py Outdated Show resolved Hide resolved
data/scannet/batch_load_scannet_data.py Show resolved Hide resolved
mmdet3d/core/evaluation/seg_eval.py Outdated Show resolved Hide resolved
tests/test_data/test_pipelines/test_indoor_sample.py Outdated Show resolved Hide resolved
mmdet3d/datasets/scannet_dataset.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Show resolved Hide resolved
configs/_base_/datasets/scannet_seg-3d-20class.py Outdated Show resolved Hide resolved
configs/_base_/datasets/scannet_seg-3d-20class.py Outdated Show resolved Hide resolved
configs/_base_/datasets/scannet_seg-3d-20class.py Outdated Show resolved Hide resolved
data/scannet/batch_load_scannet_data.py Show resolved Hide resolved
mmdet3d/core/evaluation/seg_eval.py Outdated Show resolved Hide resolved
mmdet3d/core/visualizer/show_result.py Show resolved Hide resolved
mmdet3d/datasets/scannet_dataset.py Outdated Show resolved Hide resolved
mmdet3d/datasets/scannet_dataset.py Outdated Show resolved Hide resolved
@Wuziyi616
Copy link
Contributor Author

I modify the code according to all the comments (the last 9 commits). I merge the code with master branch using rebase because there are conflicts in the code.

mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
@Wuziyi616 Wuziyi616 force-pushed the scannet_semseg_dataset branch 3 times, most recently from c0440e4 to 698a1de Compare April 2, 2021 15:41
@Wuziyi616
Copy link
Contributor Author

Merge with master branch. All comments cleared.

mmdet3d/datasets/pipelines/transforms_3d.py Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Outdated Show resolved Hide resolved
mmdet3d/datasets/pipelines/transforms_3d.py Show resolved Hide resolved
tests/test_utils/test_points.py Show resolved Hide resolved
tests/test_utils/test_points.py Outdated Show resolved Hide resolved
tools/data_converter/scannet_data_utils.py Show resolved Hide resolved
tools/data_converter/indoor_converter.py Outdated Show resolved Hide resolved
tools/data_converter/indoor_converter.py Outdated Show resolved Hide resolved
@Wuziyi616 Wuziyi616 requested a review from ZwwWayne April 6, 2021 11:44
@ZwwWayne ZwwWayne merged commit 9cb75e7 into open-mmlab:master Apr 7, 2021
@Wuziyi616 Wuziyi616 deleted the scannet_semseg_dataset branch April 7, 2021 07:42
tpoisonooo pushed a commit to tpoisonooo/mmdetection3d that referenced this pull request Sep 5, 2022
* add merge_shape_concate

* add some peephole optimization

* bug fixing

* fix for torch1.9

* add flatten cls head

* add subgraph matcher with attribute

* add ut

* fix lint

* remove onnx2ncnn

* add opset version

* axis name

* fix peephole

* fix symbol compare

* add docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants